home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Online / OpenURL / Developer / C / include / libraries / openurl.h
C/C++ Source or Header  |  1999-09-26  |  4KB  |  108 lines

  1. #ifndef LIBRARIES_OPENURL_H
  2. #define LIBRARIES_OPENURL_H
  3.  
  4. /*
  5. ** openurl.library - universal URL display and browser launcher library
  6. ** Written by Troels Walsted Hansen <troels@thule.no>
  7. ** Placed in the public domain.
  8. **
  9. ** Library definitions and structures.
  10. */
  11.  
  12. /**************************************************************************/
  13.  
  14. #ifndef EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif
  17.  
  18. #ifndef EXEC_LISTS_H
  19. #include <exec/lists.h>
  20. #endif
  21.  
  22. #ifndef EXEC_NODES_H
  23. #include <exec/nodes.h>
  24. #endif
  25.  
  26. #ifndef UTILITY_TAGITEM_H
  27. #include <utility/tagitem.h>
  28. #endif
  29.  
  30. /**************************************************************************/
  31.  
  32. #define URL_Tagbase TAG_USER
  33.  
  34. /* these tags are all you need to use openurl.library, the rest of the stuff 
  35.    in this include file is only of interest to prefs program writers.
  36. */
  37.  
  38. #define URL_Show         (URL_Tagbase + 1) /* BOOL - show/uniconify browser */
  39. #define URL_BringToFront (URL_Tagbase + 2) /* BOOL - bring browser to front */
  40. #define URL_NewWindow    (URL_Tagbase + 3) /* BOOL - open URL in new window */
  41. #define URL_Launch       (URL_Tagbase + 4) /* BOOL - launch browser when not running */
  42.  
  43. /* this is Version 3 of this structure */
  44.  
  45. #define UPF_ISDEFAULTS  (1<<0) /* V2 - structure contains the default settings */
  46. #define UPF_PREPENDHTTP (1<<1) /* V3 - prepend "http://" to URLs w/o scheme */
  47. #define UPF_DOMAILTO    (1<<2) /* V3 - mailto URLs get special treatment */
  48.  
  49. struct URL_Prefs
  50. {
  51.     UBYTE          up_Version;         /* always check this version number! */
  52.     struct MinList up_BrowserList;     /* list of struct URL_BrowserNodes */
  53.     struct MinList up_MailerList;      /* V3 - list of struct URL_MailerNodes */
  54.  
  55.     LONGBITS       up_Flags;           /* V2 - flags, see above            */
  56.     BOOL           up_DefShow;         /* these BOOLs are the defaults for */
  57.     BOOL           up_DefBringToFront; /* the similarly named tags         */
  58.     BOOL           up_DefNewWindow;    /* they are all new with Version 2  */
  59.     BOOL           up_DefLaunch;
  60. };
  61.  
  62. #define REXX_CMD_LEN 64
  63.  
  64. #define UBNF_URLONCMDLINE (1<<0) /* if set, browser supports getting an URL on 
  65.                                     the commandline when launched. obsolete as
  66.                                     of V3 - use %u on commandline instead */
  67. #define UBN_NAME_LEN         32
  68. #define UBN_PATH_LEN        256
  69. #define UBN_PORT_LEN         32
  70. #define UBN_SHOWCMD_LEN      REXX_CMD_LEN
  71. #define UBN_TOFRONTCMD_LEN   REXX_CMD_LEN
  72. #define UBN_OPENURLCMD_LEN   REXX_CMD_LEN
  73. #define UBN_OPENURLWCMD_LEN  REXX_CMD_LEN
  74.  
  75. struct URL_BrowserNode
  76. {
  77.     struct MinNode ubn_Node;
  78.     LONGBITS       ubn_Flags;                            /* flags, see above */
  79.     TEXT           ubn_Name[UBN_NAME_LEN];               /* name of webbrowser */
  80.     TEXT           ubn_Path[UBN_PATH_LEN];               /* complete path to browser */
  81.     TEXT           ubn_Port[UBN_PORT_LEN];               /* webbrowser arexx port */
  82.     TEXT           ubn_ShowCmd[UBN_SHOWCMD_LEN];         /* command to show/uniconify browser */
  83.     TEXT           ubn_ToFrontCmd[UBN_TOFRONTCMD_LEN];   /* command to bring browser to front */
  84.     TEXT           ubn_OpenURLCmd[UBN_OPENURLCMD_LEN];   /* command to open url */
  85.     TEXT           ubn_OpenURLWCmd[UBN_OPENURLWCMD_LEN]; /* command to open url in new window */
  86. };
  87.  
  88. #define UMN_NAME_LEN         32
  89. #define UMN_PATH_LEN        256
  90. #define UMN_PORT_LEN         32
  91. #define UMN_SHOWCMD_LEN      REXX_CMD_LEN
  92. #define UMN_TOFRONTCMD_LEN   REXX_CMD_LEN
  93. #define UMN_WRITEMAILCMD_LEN (REXX_CMD_LEN * 2)
  94.  
  95. struct URL_MailerNode
  96. {
  97.     struct MinNode umn_Node;
  98.     LONGBITS       umn_Flags;                              /* flags, see above */
  99.     TEXT           umn_Name[UMN_NAME_LEN];                 /* name of mailer */
  100.     TEXT           umn_Path[UMN_PATH_LEN];                 /* complete path to mailer */
  101.     TEXT           umn_Port[UMN_PORT_LEN];                 /* mailer arexx port */
  102.     TEXT           umn_ShowCmd[UMN_SHOWCMD_LEN];           /* command to show/uniconify mailer */
  103.     TEXT           umn_ToFrontCmd[UMN_TOFRONTCMD_LEN];     /* command to bring mailer to front */
  104.     TEXT           umn_WriteMailCmd[UMN_WRITEMAILCMD_LEN]; /* command to write mail */
  105. };
  106.  
  107. #endif  /* LIBRARIES_OPENURL_H */
  108.